﻿@using CashFlow.Web.Models.Order.Result;
@{
    ViewBag.Title = "Performance";
    Layout = "~/Views/Shared/_Layout3.cshtml";
    var date = ViewBag.Date as string;
    var ls = ViewBag.OrderList as IList<OrderBuySellInfoModel>;
    var count = ls.Count();
    var amount = ls.Sum(x => x.Amount);
}
<style type="text/css">
    .title {
        height: 40px;
        line-height: 40px;
        font-size: 20px;
        font-weight: 800;
        text-align: center;
        padding-top: 10px;
    }

    .list {
        width: 85%;
        margin: 0px auto;
        padding-bottom: 20px;
        margin-top: 10px;
    }

    .list-item {
        background-color: white;
        border-radius: 10px;
        font-size: 16px;
        margin-top: 15px;
    }

        .list-item:first-child {
            margin-top: 0px;
        }

    .list-item-row {
        height: 40px;
        line-height: 40px;
    }

        .list-item-row span:first-child {
            color: #999;
            width: 100px;
            display: inline-block;
            text-align: right;
        }

        .list-item-row span:last-child {
            margin-left: 10px;
        }

    .statistics {
        width: 85%;
        margin: 0px auto;
        padding-bottom: 20px;
        margin-top: 10px;
    }

        .statistics .list-item-row > span:last-child {
            font-size: 20px;
            color: red;
        }

    .list-item-row .incompleteOrderStatus {
        color: red;
    }
</style>
<div class="title">订单统计(@date)</div>
<div class="statistics">
    <div class="list-item">
        <div class="list-item-row"><span>订单总数:</span><span>@count</span></div>
        <div class="list-item-row"><span>订单总金额:</span><span>￥@amount</span></div>
    </div>
</div>
<div class="list">
    @{
        foreach (var item in ls)
        {
            <div class="list-item">
                <div class="list-item-row"><span>买家:</span><span>@item.Buyer</span></div>
                <div class="list-item-row"><span>订单金额:</span><span>￥@item.Amount</span></div>
                <div class="list-item-row"><span>卖家:</span><span>@item.Seller</span></div>
                @if (item.State >= 1)
                {
                    <div class="list-item-row"><span>订单状态:</span><span>已完成</span></div>
                }
                else
                {
                    <div class="list-item-row"><span>订单状态:</span><span class="incompleteOrderStatus">未完成</span></div>
                }
            </div>
        }
    }
</div>